﻿<%@ Page Language="C#" Inherits="E.Web.Teacher.internals.exam.Edit" %>

<%@ Import Namespace="E.Model" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>试卷信息</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link rel="stylesheet" href="/css/main.css" type="text/css" media="all" />
    <link rel="stylesheet" href="/css/t_main.css" type="text/css" media="all" />
    <link rel="stylesheet" href="/css/exam.css" type="text/css" media="all" />
    <link rel="stylesheet" href="/css/flora.datepick.css" type="text/css" media="all" />
    <script type="text/javascript" src="/js/exam.js?sid=<%=DateTime.Now %>"></script>
    <script type="text/javascript" src="/js/ajax.js"></script>
    <script type="text/javascript" src="/js/jquery-1.4.2.min.js"></script>
    <script type="text/javascript" src="/js/jquery.datepick.min.js"></script>
    <script type="text/javascript" src="/js/jquery.datepick-zh-CN.js"></script>
    <script type="text/javascript">
        window.onload = function () {
            document.getElementById("form1").style.display = "";
        }
        $(document).ready(
      function () {
          $("#StartTimeTxt").datepick({ dateFormat: 'yy-mm-dd', showOn: 'button', buttonImage: '/images/icon/calendar-green.gif', buttonImageOnly: true });
          $("#EndTimeTxt").datepick({ dateFormat: 'yy-mm-dd', showOn: 'button', buttonImage: '/images/icon/calendar-green.gif', buttonImageOnly: true });
      }
    );
    </script>
</head>
<body>
    <form id="form1" method="post" action="" style="display: none;">
    <div class="m_top">
    </div>
    <div class="block_2">
        <div style="width: 650px; height: 22px;">
            <div class="title">
                &nbsp;试卷信息</div>
        </div>
        <div class="spe_line_2">
        </div>
        <div class="box_1">
            <div class="fl tr left">
                <span class="hint">*</span>试卷名称：</div>
            <div class="fl">
                <input type="text" id="TitleTxt" name="TitleTxt" value="<%=model.Title%>" style="width: 400px;" /></div>
        </div>
            <div class="box_1">
            <div class="fl tr left">
                <span class="hint">*</span>题目选择：</div>
            <div class="fl">
            
                <input type="radio" id="rQuestionRandom" name="rQuestionStyle" value="1" onclick="GetEmptySettingTemplate();" 
                <% 
                    if((act == "u" && model.IsRandom == 1) || act == "n")
                    {
                        Response.Write("checked='checked' ");
                    }
                 %> />随机
                <input type="radio" id="rQuestionCustomer" name="rQuestionStyle" value="0" onclick="GetEmptySettingTemplate();" 
                 <% 
                    if((act == "u" && model.IsRandom == 0) || act == "n")
                    {
                        Response.Write("checked='checked' ");
                    }
                 %> 
                />自定义
            </div>
        </div>
        <div class="box_1">
            <div class="fl tr left">
                <span class="hint">*</span>试卷类型：</div>
            <div class="fl">
                <% if (categoryList != null && categoryList.Count > 0)
                   { %>
                <select id="ExamCategorySlt" name="ExamCategorySlt" onchange="GetEmptySettingTemplate();">
                    <option value="-1">请选择</option>
                    <% foreach (System.Collections.Generic.KeyValuePair<int, string> kvp in categoryList)
                       { %>
                    <option value="<%=kvp.Key %>">
                        <%=kvp.Value%></option>
                    <% } %>
                </select>
                <% } %>
                <%--<select id="RelationSlt" name="RelationSlt" onchange="GetCertificateEmptySettingTemplate(this.value);">
            <option value="-1">请选择</option>
          </select>--%>
            </div>
        </div>
      
        <div class="box_1">
            <div class="fl tr left">
                <span class="hint">*</span>项目及课程：</div>
            <div class="fl">
                <% if (certificateList != null && certificateList.Count > 0)
                   { %>
                <select id="CertificateSlt" name="CertificateSlt" onchange="GetEmptySettingTemplate();">
                    <option value="-1">请选择认证类别</option>
                    <% foreach (System.Collections.Generic.KeyValuePair<int, string> kvp in certificateList)
                       { %>
                    <option value="<%=kvp.Key %>">
                        <%=kvp.Value%></option>
                    <% } %>
                </select>
                <select id="CourseSlt" name="CourseSlt" onchange="T()">
                    <option value="-1">请选择课程</option>
                </select>
                <% } %>
            </div>
        </div>
      
        <% if (act == "u")
           { %>
        <div class="box_1">
            <div class="fl tr left">
                <span class="hint">*</span>开始时间：</div>
            <div class="fl">
                <input type="text" id="StartTimeTxt" name="StartTimeTxt" value="<%=model.StartTime.ToString("yyyy.M.d")%>" /></div>
        </div>
        <div class="box_1">
            <div class="fl tr left">
                <span class="hint">*</span>结束时间：</div>
            <div class="fl">
                <input type="text" id="EndTimeTxt" name="EndTimeTxt" value="<%=model.EndTime.ToString("yyyy.M.d")%>" /></div>
        </div>
        <% }
           else
           { %>
        <div class="box_1">
            <div class="fl tr left">
                <span class="hint">*</span>开始时间：</div>
            <div class="fl">
                <input type="text" id="StartTimeTxt" name="StartTimeTxt" /></div>
        </div>
        <div class="box_1">
            <div class="fl tr left">
                <span class="hint">*</span>结束时间：</div>
            <div class="fl">
                <input type="text" id="EndTimeTxt" name="EndTimeTxt" /></div>
        </div>
        <% } %>
        <div class="box_1">
            <div class="fl tr left">
                <span class="hint">*</span>考试总分：</div>
            <div class="fl dis_r">
                <input type="text" id="TotalScoreTxt" name="TotalScoreTxt" value="<%=model.TotalScore %>" /></div>
        </div>
        <div class="box_1">
            <div class="fl tr left">
                <span class="hint">*</span>通过分数：</div>
            <div class="fl dis_r">
                <input type="text" id="PassScoreTxt" name="PassScoreTxt" value="<%=model.PassScore %>" /></div>
        </div>
        <div class="box_1">
            <div class="fl tr left">
                <span class="hint">*</span>考试时间：</div>
            <div class="fl">
                <input type="text" id="ExamTimeTxt" name="ExamTimeTxt" value="<%=model.ExamTime %>" />分钟</div>
        </div>
        <div class="box_1">
            <div class="fl tr left">
                <span class="hint">*</span>地区：</div>
            <div class="fl">
                <ul>
                    <% if (areaList != null && areaList.Count > 0)
                       { %>
                    <% int i = 0; %>
                    <% foreach (DictAreaModel areaModel in areaList)
                       { %>
                    <li>
                        <input type="checkbox" id="AreaChb_<%=i %>" name="AreaChb" class="fl c_chb" value="<%=areaModel.ID%>" /><div
                            class="fl left_2">
                            &nbsp;<%=areaModel.Name%></div>
                    </li>
                    <% i++; %>
                    <% } %>
                    <% } %>
                </ul>
            </div>
        </div>
    </div>
    <div class="block_2">
        <div style="width: 650px; height: 22px;">
            <div class="title">
                &nbsp;试卷设置</div>
                <div id="defaultlink" style="display:none;height:25px; float:right;">
                <a  onclick="javascript:DefaultSlt.style.display='';this.style.display='none';"  style="cursor: pointer;color:Blue;"   >点击选择试卷模板</a>
                <select id="DefaultSlt" style=" display:none" name="DefaultSlt" onchange="defaultS();">
                    <option value="-1">请选择模板</option>
                    <% foreach (ExamDefaultModel kvp in defaultList)
                       { %>
                      <option value="<%=kvp.CategoryIDArr %>|<%=kvp.QuestionQuantityArr%>|<%=kvp.RequiredQuestionQuantityArr%>"><%=kvp.DefaultName%></option>
                    <% } %>
                  </select>
              </div>
        </div>
        <div class="spe_line_2">
        </div>
        <div id="datatable">
            <div id="SettingTemplateDiv">
            </div>
        </div>
        <div style="margin-top: 10px;">
            <a href="javascript:GetTotalScore();">查看总分</a>&nbsp;<span id="TotalScoreLb"></span></div>
    </div>
    <div class="block_2">
        <input type="hidden" id="act" name="act" value="<%=act %>" />
        <input type="hidden" id="id" name="id" value="<%=id %>" />
        <input type="hidden" id="chk_v" name="chk_v" />
        <input type="hidden" id="area_v" name="area_v" value="<%=area_v %>" />
        <input type="hidden" id="inputvalue" name="inputvalue" value="" />
        <input type="hidden" id="inputvalue_re" name="inputvalue_re" value="" />
        <input type="hidden" id="targetArr" name="targetArr" value="<%=targetArr %>" />
        <input type="hidden" id="valueArr" name="valueArr" value="<%=valueArr %>" />
        <input type="hidden" id="valueArr_re" name="valueArr_re" value="<%=valueArr_re %>" />
        <input type="hidden" id="valueQuestionArr" name="valueQuestionArr" value="<%=questionIDArr %>" />
        <div style="width: 350px; margin-top: 20px; text-align: center;">
            <input type="image" src="/images/btn/confirm.gif" style="width: 52px; height: 22px;"
                onclick="return CheckExamForm();" />
            <%--<% if (act == "u") { %>
        &nbsp;&nbsp;<a href="javascript:history.back();"><img alt="" src="/images/btn/back.gif" /></a>
        <% } %>--%>
        </div>
    </div>
    <script type="text/javascript">
      <% if (act == "u") { %>
      
      //$("#ExamCategorySlt").val('<%=cid %>');
      InitAreaData();
      var page_categoryid = <%=(int)model.CategoryID %>;
      var page_certificateid = -1;
      var page_courseid = -1;
      switch(page_categoryid){
        case -1:
          break;
        case 1:
          page_certificateid = <%=model.CertificateID %>;
          page_courseid = <%=model.CourseCertificateID %>;
          break;
        case 2:
          page_certificateid = <%=model.CourseCertificateID %>;
          break;
        default: break;
      }
      GetEmptySettingTemplateBase(page_categoryid,page_certificateid,page_courseid);
      setTimeout(function(){ $("#ExamCategorySlt").val(page_categoryid); $("#CertificateSlt").val(page_certificateid); $("#CourseSlt").val(page_courseid); },500);
      SetSettingValue(page_categoryid,page_certificateid,page_courseid);
      <% } %>
      
    </script>
    </form>
</body>
</html>
